﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using System.Runtime.Serialization;
using PMisuseAn.behaviour.model;

namespace PMisuseAn.io
{
    [Serializable()]
    public class GroupDB : ISerializable
    {
        public Group group;
        public string clusterName;


        //Default constructor
        public GroupDB(Group group_)
        {
            group = group_;
            clusterName = MainWindow.clusterName;
        }

        //Deserialization constructor.
        public GroupDB(SerializationInfo info, StreamingContext ctxt)
        {
            //Get the values from info and assign them to the appropriate properties
            clusterName = (string)info.GetValue("projectClusterName", typeof(string));
            group = (Group)info.GetValue("group", typeof(Group));
        }
        
        //Serialization function.
        public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
        {
            info.AddValue("projectClusterName", clusterName);
            info.AddValue("group", group);
        }

    }
}


